import pyautogui

# 获取当前屏幕分辨率

screenWidth, screenHeight = pyautogui.size()

# 获取当前鼠标位置Hello world!

currentMouseX, currentMouseY = pyautogui.position()

# 鼠标移动坐标为100,100位置  绝对移动

pyautogui.moveTo(300, 200)

# 鼠标左击

pyautogui.click()

# 在每次输入之间暂停0.25秒

pyautogui.typewrite('Hello world!', interval=0.25)

# 鼠标乡下移动  相对移动

#pyautogui.moveRel(None, 10)

# 键盘点击enter

pyautogui.press('enter')

pyautogui.typewrite('Hello world!', interval=0.25)

# 按住shift键

pyautogui.keyDown('shift')
pyautogui.press(['left', 'left', 'left', 'left', 'left', 'left'])

# 放开shift键

pyautogui.keyUp('shift')
pyautogui.hotkey('ctrl', 'c')